<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<h2>用户登录</h2>
<form method="post">
  {% csrf_token %}
  用户名: <input type="text" name="username"><br>
  密码: <input type="password" name="password"><br>
  <input type="submit" value="登录">
</form>
<a href="{% url 'register' %}">没有账号？去注册</a>
{% if error %}
<h4>{{error}}</h4>
{% endif %}
</body>
</html>